Conversation
|
Hi @AntonioVT, |
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| acr cache create | cmd acr cache create added parameter identity |
||
| acr cache update | cmd acr cache update added parameter identity |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
This PR adds user-assigned managed identity support to az acr cache create / az acr cache update so cache rules can authenticate to upstream registries without credential sets, and updates the ACR SDK/API version and tests to support the new capability.
Changes:
- Add
--identitysupport for ACR cache rule create/update and wire it into request models. - Introduce validation for user-assigned identity ARM IDs and add live test + recording coverage.
- Bump
azure-mgmt-containerregistryand move ACR cache rules to2026-01-01-previewAPI version (including profile updates).
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/azure-cli/setup.py |
Bumps azure-mgmt-containerregistry version to support new cache rule identity fields. |
src/azure-cli/azure/cli/command_modules/acr/cache.py |
Adds identity support to cache create/update request payloads via SDK models. |
src/azure-cli/azure/cli/command_modules/acr/_validators.py |
Adds validation for cache credential option combinations and identity ARM ID format. |
src/azure-cli/azure/cli/command_modules/acr/_params.py |
Exposes --identity and hooks validation into argument parsing. |
src/azure-cli/azure/cli/command_modules/acr/_constants.py |
Adds a template used to display identity ARM ID format examples. |
src/azure-cli/azure/cli/command_modules/acr/_client_factory.py |
Switches cache rules client to 2026-01-01-preview. |
src/azure-cli-core/azure/cli/core/profiles/_shared.py |
Updates ACR cache rules default API version and adjusts API version resolution behavior. |
src/azure-cli/azure/cli/command_modules/acr/tests/latest/test_acr_commands.py |
Adds a managed identity live test for cache rules. |
src/azure-cli/azure/cli/command_modules/acr/tests/latest/recordings/test_acr_cache_managed_identity.yaml |
Adds the recording for the new managed identity scenario test. |
src/azure-cli/HISTORY.rst |
Documents the new --identity parameter in release history. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
67d8388 to
655720e
Compare
|
/azp run |
|
Commenter does not have sufficient privileges for PR 33040 in repo Azure/azure-cli |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Fix trailing whitespace in cache.py and _validators.py - Break long lines to stay under 120 char limit - Add pylint disable for unused-argument on acr_cache_update_get - Add re.IGNORECASE flag to identity resource ID regex match Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…for status polling
882071d to
c192891
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
az acr cache create/update: Add --identity parameter to support using user-assigned managed identity for cache rules
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Related command
az acr cache create
az acr cache update
Description
This PR adds managed identity support for Azure Container Registry cache rules as an alternative authentication method to credential sets. Users can now authenticate cache rules with upstream registries using user-assigned managed identities instead of storing credentials in Azure Key Vault.
Changes made
--identityparameter toaz acr cache createandaz acr cache updatecommandsTesting Guide
Prerequisites: Create two ACR registries (source and target)
az acr create -n sourceregistry -g myResourceGroup --sku Standard -l eastusaz acr create -n targetregistry -g myResourceGroup --sku Standard -l eastusImport a test image to the source registry
az acr import -n sourceregistry --source mcr.microsoft.com/dotnet/runtime-deps:8.0Create a user-assigned managed identity
az identity create -n cache-identity -g myResourceGroup -l eastusGet the identity resource ID
IDENTITY_ID=$(az identity show -n cache-identity -g myResourceGroup --query id -o tsv)Create cache rule with managed identity
az acr cache create -r targetregistry -n dotnet-cache -s sourceregistry.azurecr.io/dotnet/runtime-deps -t dotnet-runtime-deps --identity $IDENTITY_IDUpdate cache rule to use different managed identity
az identity create -n cache-identity2 -g myResourceGroup -l eastusIDENTITY_ID2=$(az identity show -n cache-identity2 -g myResourceGroup --query id -o tsv)az acr cache update -r targetregistry -n dotnet-cache --identity $IDENTITY_ID2This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.